package com.itasura.method.invocation;

import java.util.concurrent.ExecutionException;

/**
 * 异步结果
 * @author sailor wang
 * @date 2018/9/1 下午12:30
 * @description
 */
public interface AsyncResult<T> {

    /**
     * 异步任务执行完成获取结果
     * @return
     * @throws ExecutionException
     */
    T getValue() throws ExecutionException;

    /**
     * 异步task执行状态
     * @return
     */
    boolean isCompleted();

    /**
     * 阻塞当前线程直到执行完成
     * @throws InterruptedException
     */
    void await() throws InterruptedException;
}